package com.demo2do.fms.admin.service.authority;

import java.util.List;
import java.util.Map;

import com.demo2do.core.entity.page.Page;
import com.demo2do.fms.admin.service.DataService;
import com.demo2do.fms.entity.authority.Resource;
import com.demo2do.fms.entity.authority.ResourceType;
import com.demo2do.fms.entity.authority.Role;
import com.demo2do.fms.entity.authority.RoleTemplate;
import com.demo2do.fms.entity.authority.User;

/**
 * 
 * @author Ysy
 *
 */
public interface ResourceService extends DataService<Resource> {
    
    /**
     * 
     * @param template
     * @return
     */
    public int count(RoleTemplate template);
    
    /**
     * 
     * @param template
     * @param page
     * @return
     */
    public List<Resource> list(RoleTemplate template, Page page);
    
    /**
     * 
     * @param template
     * @param type
     * @return
     */
    public List<String> list(RoleTemplate template, ResourceType type);
    
    /**
     * count resource by role
     * 
     * @param role
     * @return
     */
    public int count(Role role);
    
    /**
     * list resources by role and page
     * 
     * @param role
     * @param page
     * @return
     */
    public List<Resource> list(Role role, Page page);
    
    
    /**
     * count resource by user
     * 
     * @param user
     * @return
     */
    public int count(User user);
    
    /**
     * list resources by user and page
     * 
     * @param user
     * @param page
     * @return
     */
    public List<Resource> list(User user, Page page);
    
    /**
     * list resources'name mapped by type
     * 
     * @param user
     * @return
     */
    public Map<String, List<String>> list(User user);
    
}
